import {rolelist} from '../../../request/api'

interface Role{
    roleList:Array<object>
}

const state = {
    roleList:[]
}

const getters = {
    getRole(state:Role){
        return state.roleList
    }
}

const mutations = {
    REQ_ROLE(state:Role,payload:any){
        state.roleList = payload
    }
}

const actions = {
    async getActionsRole({commit}:any){
        let res = await rolelist()
        console.log(res);
        commit('REQ_ROLE',res.list)
    }
}

export default {
    state,
    getters,
    mutations,
    actions,
    namespaced:true
}